// fpDoubleSingle.h: interface for the fpDoubleSingle class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_FPDOUBLESINGLE_H__B78A8855_8510_11D2_A42D_006097A44215__INCLUDED_)
#define AFX_FPDOUBLESINGLE_H__B78A8855_8510_11D2_A42D_006097A44215__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#ifdef FPCONTROLS
#ifndef _UNICODE

class CLASS_DECL_D fpDoubleSingle : public AWTComponent  
{
DECLARE_DYNAMIC(fpDoubleSingle)
public:
	fpDoubleSingle();
	fpDoubleSingle(LPTSTR text);
	fpDoubleSingle(CString& text);
	fpDoubleSingle(int columns);
	virtual ~fpDoubleSingle();

	int getColumns() 
		{return m_columns;}
	void setColumns(int columns);
	CSize getPreferredSize(int columns)
		{return preferredSize(columns);}
	CSize preferredSize(int columns);
	CSize getPreferredSize()
		{return preferredSize();}
	CSize preferredSize();
	CSize getMinimumSize(int columns)
		{return minimumSize(columns);}
	CSize minimumSize(int columns);
	CSize getMinimumSize()
		{return minimumSize();}
	CSize minimumSize();
	void setText(CString& text);
	CString& getText();

	void addActionListener(AWTActionListener* l) 
		{m_actionListener = AWTEventMulticaster::add(m_actionListener, l);}
  void removeActionListener(AWTActionListener* l) 
		{m_actionListener = AWTEventMulticaster::remove(m_actionListener, l);}
	void processActionEvent(AWTActionEvent* e) 
	{
    if (m_actionListener != NULL) 
			m_actionListener->actionPerformed(e);
  }
	virtual BOOL isFocusTraversable()
		{return TRUE;}

	void setDecimalPlaces(int decimalPlaces);
	int getDecimalPlaces()
		{return m_decimalPlaces;}
	void setMin(double min);
	void setMax(double max);
	virtual void setForeground(AWTColor* c);

private:
	void construct(CString &text, int columns)
	{
		m_name = text;
		m_text = text;
		m_columns = columns;
		m_actionListener = NULL;
		m_decimalPlaces = -1;
		m_min = 0.0;
		m_max = 999999999999.0;
	}

protected:
	CWnd* createComponent();

	CString m_text;
	int m_columns;
	AWTActionListener* m_actionListener;
	int m_decimalPlaces;
	double m_min;
	double m_max;
};

#endif
#endif

#endif // !defined(AFX_FPDOUBLESINGLE_H__B78A8855_8510_11D2_A42D_006097A44215__INCLUDED_)
